{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-08-01T06:20:46.524242Z",
     "start_time": "2025-08-01T06:20:46.504236Z"
    }
   },
   "source": "a = 2025",
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:21:16.658254Z",
     "start_time": "2025-08-01T06:21:16.636982Z"
    }
   },
   "cell_type": "code",
   "source": "print(a)",
   "id": "f3d7200a218e9ed",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2025\n"
     ]
    }
   ],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T01:39:02.645732Z",
     "start_time": "2025-08-04T01:39:02.494173Z"
    }
   },
   "cell_type": "code",
   "source": "import numpy as np",
   "id": "a99e727f2abd91b4",
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:29:26.125201Z",
     "start_time": "2025-08-01T06:29:26.110906Z"
    }
   },
   "cell_type": "code",
   "source": "arr = np.array([1, \"hello\"])",
   "id": "150e08c36e777e86",
   "outputs": [],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:29:33.372641Z",
     "start_time": "2025-08-01T06:29:33.362453Z"
    }
   },
   "cell_type": "code",
   "source": "print(arr)",
   "id": "525cf77dbcca8e0d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['1' 'hello']\n"
     ]
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:30:47.573230Z",
     "start_time": "2025-08-01T06:30:47.559755Z"
    }
   },
   "cell_type": "code",
   "source": "print(arr.dtype)",
   "id": "c30f534704160fe9",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<U21\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:30:55.507213Z",
     "start_time": "2025-08-01T06:30:55.487127Z"
    }
   },
   "cell_type": "code",
   "source": "print(arr.shape)",
   "id": "ed98822684a7f637",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2,)\n"
     ]
    }
   ],
   "execution_count": 8
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:50:20.939897Z",
     "start_time": "2025-08-01T06:50:20.932343Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([1, 2, 3, 4, 5])\n",
    "print(arr.dtype)"
   ],
   "id": "8582c4c62e6ce43c",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "int64\n"
     ]
    }
   ],
   "execution_count": 9
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:50:58.577350Z",
     "start_time": "2025-08-01T06:50:58.558350Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([1.1, 2.2, 3.3, 4.4, 5.5])\n",
    "print(arr.dtype)"
   ],
   "id": "b2e164a15b8d7d90",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "float64\n"
     ]
    }
   ],
   "execution_count": 10
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T06:52:09.395564Z",
     "start_time": "2025-08-01T06:52:09.388287Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([\"1\", \"2\", \"hello\"])\n",
    "print(arr)\n",
    "print(arr.dtype)"
   ],
   "id": "4d1418e428c7813f",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['1' '2' 'hello']\n",
      "<U5\n"
     ]
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T07:10:34.978011Z",
     "start_time": "2025-08-01T07:10:34.970277Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.zeros((2, 3))\n",
    "print(arr)"
   ],
   "id": "6d211507b407ec24",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0. 0. 0.]\n",
      " [0. 0. 0.]]\n"
     ]
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T07:15:47.092319Z",
     "start_time": "2025-08-01T07:15:47.078565Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.empty((4, 6))\n",
    "print(arr)"
   ],
   "id": "1564ff689a35bb2b",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 1.34557547e-311  1.34557547e-311  9.88131292e-324  4.94065646e-323\n",
      "   0.00000000e+000 -1.65440884e-310]\n",
      " [-1.34557911e-311  1.92873337e+056  1.34557547e-311  1.34557547e-311\n",
      "   4.44659081e-323  9.88131292e-324]\n",
      " [ 0.00000000e+000 -1.69090674e-310 -6.95301265e-310 -5.79966070e-272\n",
      "   1.34557547e-311  1.34557547e-311]\n",
      " [ 9.38724727e-323  6.42285340e-323  0.00000000e+000 -1.74522982e-310\n",
      "  -1.34557911e-311  9.77237356e+125]]\n"
     ]
    }
   ],
   "execution_count": 15
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T07:18:46.883573Z",
     "start_time": "2025-08-01T07:18:46.864469Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.full((4, 5), 2025)\n",
    "print(arr)"
   ],
   "id": "ba749d5d1f1f28fe",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[2025 2025 2025 2025 2025]\n",
      " [2025 2025 2025 2025 2025]\n",
      " [2025 2025 2025 2025 2025]\n",
      " [2025 2025 2025 2025 2025]]\n"
     ]
    }
   ],
   "execution_count": 16
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T07:38:13.231962Z",
     "start_time": "2025-08-01T07:38:13.217964Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.logspace(0, 10, 10, base=2)\n",
    "print(arr)"
   ],
   "id": "a70898559cfdb002",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1.00000000e+00 2.16011948e+00 4.66611616e+00 1.00793684e+01\n",
      " 2.17726400e+01 4.70315038e+01 1.01593667e+02 2.19454460e+02\n",
      " 4.74047853e+02 1.02400000e+03]\n"
     ]
    }
   ],
   "execution_count": 17
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T07:51:13.767235Z",
     "start_time": "2025-08-01T07:51:13.752856Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.eye(3)\n",
    "print(arr)"
   ],
   "id": "1c7f07bbdda4f1b3",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1. 0. 0.]\n",
      " [0. 1. 0.]\n",
      " [0. 0. 1.]]\n"
     ]
    }
   ],
   "execution_count": 18
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T07:54:13.768717Z",
     "start_time": "2025-08-01T07:54:13.752022Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.diag([1, 2, 3])\n",
    "print(arr)"
   ],
   "id": "7688400169aaee54",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 0 0]\n",
      " [0 2 0]\n",
      " [0 0 3]]\n"
     ]
    }
   ],
   "execution_count": 19
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T08:01:06.418829Z",
     "start_time": "2025-08-01T08:01:06.238044Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.random.rand(2, 3)\n",
    "print(arr)"
   ],
   "id": "3e3f6b0e8ef3899d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0.01143508 0.21693749 0.51757995]\n",
      " [0.70266252 0.06331525 0.69923632]]\n"
     ]
    }
   ],
   "execution_count": 20
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T08:03:50.157985Z",
     "start_time": "2025-08-01T08:03:50.149527Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.random.uniform(3, 6, (2, 3))\n",
    "print(arr)"
   ],
   "id": "f905ee988e83ce3d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[4.99044371 3.65337083 4.42793148]\n",
      " [3.39662987 3.92669989 3.94983007]]\n"
     ]
    }
   ],
   "execution_count": 21
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T08:05:45.077128Z",
     "start_time": "2025-08-01T08:05:45.057599Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.random.randint(3, 6, (2, 3))\n",
    "print(arr)"
   ],
   "id": "2aa6a45bb30bbd04",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[4 3 3]\n",
      " [3 3 4]]\n"
     ]
    }
   ],
   "execution_count": 23
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T08:08:05.556288Z",
     "start_time": "2025-08-01T08:08:05.548437Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.random.randn(2, 3)\n",
    "print(arr)"
   ],
   "id": "7d8c4197e2ee4a19",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-0.74135332  0.14531453  0.79873901]\n",
      " [ 0.67320132 -0.77720136  0.00430531]]\n"
     ]
    }
   ],
   "execution_count": 24
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-01T08:44:41.767854Z",
     "start_time": "2025-08-01T08:44:41.754434Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.random.randint(1, 100, (4, 8))\n",
    "print(arr)\n",
    "print(arr[1, 3])"
   ],
   "id": "6f8b13fbc19859d3",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[64 78 54 66 10 23 40 67]\n",
      " [64  5 76 64 10 98 52 92]\n",
      " [ 9 28 74 67 28 57  5 41]\n",
      " [35 90 39 80 86 46 95 78]]\n",
      "64\n"
     ]
    }
   ],
   "execution_count": 26
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T01:12:42.963668Z",
     "start_time": "2025-08-02T01:12:42.942644Z"
    }
   },
   "cell_type": "code",
   "source": [
    "a = np.array([1, 2, 3])\n",
    "b = np.array([4, 5, 6])\n",
    "print(a + b)"
   ],
   "id": "77246224650ad5a6",
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001B[31m---------------------------------------------------------------------------\u001B[39m",
      "\u001B[31mNameError\u001B[39m                                 Traceback (most recent call last)",
      "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[2]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m a = np.array([\u001B[32m1\u001B[39m,\u001B[32m2\u001B[39m,\u001B[32m3\u001B[39m])\n\u001B[32m      2\u001B[39m b = np.array([\u001B[32m4\u001B[39m,\u001B[32m5\u001B[39m,\u001B[32m6\u001B[39m])\n\u001B[32m      3\u001B[39m \u001B[38;5;28mprint\u001B[39m(a + b)\n",
      "\u001B[31mNameError\u001B[39m: name 'np' is not defined"
     ]
    }
   ],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T01:32:38.004563Z",
     "start_time": "2025-08-02T01:32:38.001461Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "\n",
    "a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n",
    "b = np.array(([7, 8, 9], [1, 2, 3], [4, 5, 6]))\n",
    "\n",
    "print(a[0][1])\n",
    "\n",
    "print(a * b)"
   ],
   "id": "2ebb0e1291e960f8",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "[[ 7 16 27]\n",
      " [ 4 10 18]\n",
      " [28 40 54]]\n"
     ]
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T01:32:41.158996Z",
     "start_time": "2025-08-02T01:32:41.154512Z"
    }
   },
   "cell_type": "code",
   "source": "print(a @ b)",
   "id": "79e0d43e4baccf4f",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 21  27  33]\n",
      " [ 57  72  87]\n",
      " [ 93 117 141]]\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T01:56:51.178660Z",
     "start_time": "2025-08-02T01:56:51.173147Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.sin(1))",
   "id": "a864249de7445641",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.8414709848078965\n"
     ]
    }
   ],
   "execution_count": 8
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T01:58:46.029100Z",
     "start_time": "2025-08-02T01:58:46.023431Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([-1, 1, 2, -3])\n",
    "print(np.abs(arr))"
   ],
   "id": "e5bfa2277b305fad",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 1 2 3]\n"
     ]
    }
   ],
   "execution_count": 9
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T02:03:12.645955Z",
     "start_time": "2025-08-02T02:03:12.642521Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.round([3.2, 4.5, 4.6, 8.1, 9.6]))",
   "id": "e7cd6b9912be5eaf",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 3.  4.  5.  8. 10.]\n"
     ]
    }
   ],
   "execution_count": 11
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T02:42:24.017850Z",
     "start_time": "2025-08-02T02:42:24.012836Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([1.6, 25.1, 81.7])\n",
    "print(np.ceil(arr))"
   ],
   "id": "dc3593b44d44dca4",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 2. 26. 82.]\n"
     ]
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T02:48:02.580798Z",
     "start_time": "2025-08-02T02:48:02.575728Z"
    }
   },
   "cell_type": "code",
   "source": "np.isnan([1, 2, 3])",
   "id": "da5d2da3768e5000",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False, False])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T02:48:48.791484Z",
     "start_time": "2025-08-02T02:48:48.785625Z"
    }
   },
   "cell_type": "code",
   "source": "np.isnan([1, 2, np.nan, 3])",
   "id": "c71f020fce49086c",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False,  True, False])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 14
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T02:56:33.854524Z",
     "start_time": "2025-08-02T02:56:33.851022Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.median([1, 2, 3, 100, 200]))",
   "id": "f04f66fd81689b17",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.0\n"
     ]
    }
   ],
   "execution_count": 18
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T02:57:48.898288Z",
     "start_time": "2025-08-02T02:57:48.895816Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.median([1, 2, 3, 6, 8, 10]))",
   "id": "13ea9b63def0865d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4.5\n"
     ]
    }
   ],
   "execution_count": 20
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-02T12:29:50.365656Z",
     "start_time": "2025-08-02T12:29:50.242173Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "\n",
    "print(np.std([1, 2, 3]))"
   ],
   "id": "26c6ae9ee34922dc",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.816496580927726\n"
     ]
    }
   ],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T01:39:19.457125Z",
     "start_time": "2025-08-04T01:39:19.450538Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.var([1, 2, 3]))",
   "id": "2775b465d441e066",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.6666666666666666\n"
     ]
    }
   ],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T01:50:50.063688Z",
     "start_time": "2025-08-04T01:50:50.054674Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n",
    "print(np.cumsum(arr))"
   ],
   "id": "c281fd8b4729ed35",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 1  3  6 10 15 21 28 36 45 55]\n"
     ]
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T01:52:05.543062Z",
     "start_time": "2025-08-04T01:52:05.535095Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.cumprod(arr))",
   "id": "951f37994c969ed4",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[      1       2       6      24     120     720    5040   40320  362880\n",
      " 3628800]\n"
     ]
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:00:05.125233Z",
     "start_time": "2025-08-04T02:00:05.118413Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.greater([3, 4, 5, 6, 7], 4))",
   "id": "ff9121590376a702",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[False False  True  True  True]\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:01:13.884144Z",
     "start_time": "2025-08-04T02:01:13.875289Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.less([3, 4, 5, 6, 7, 8], 4))",
   "id": "563f0a2cded47eee",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ True False False False False False]\n"
     ]
    }
   ],
   "execution_count": 9
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:01:43.302705Z",
     "start_time": "2025-08-04T02:01:43.292886Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.equal([3, 4, 5, 6, 7, 8], 4))",
   "id": "6d7fb88d150120b8",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[False  True False False False False]\n"
     ]
    }
   ],
   "execution_count": 10
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:04:13.854834Z",
     "start_time": "2025-08-04T02:04:11.619643Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.equal([3, 4, 5], [3, 4, 6, 7]))",
   "id": "5058fea54cefce77",
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "operands could not be broadcast together with shapes (3,) (4,) ",
     "output_type": "error",
     "traceback": [
      "\u001B[31m---------------------------------------------------------------------------\u001B[39m",
      "\u001B[31mValueError\u001B[39m                                Traceback (most recent call last)",
      "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[12]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[38;5;28mprint\u001B[39m(np.equal([\u001B[32m3\u001B[39m,\u001B[32m4\u001B[39m,\u001B[32m5\u001B[39m],[\u001B[32m3\u001B[39m,\u001B[32m4\u001B[39m,\u001B[32m6\u001B[39m,\u001B[32m7\u001B[39m]))\n",
      "\u001B[31mValueError\u001B[39m: operands could not be broadcast together with shapes (3,) (4,) "
     ]
    }
   ],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:08:00.257102Z",
     "start_time": "2025-08-04T02:08:00.249708Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.logical_and([0, 0], [1, 1]))",
   "id": "9104839dc10f7cb1",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[False False]\n"
     ]
    }
   ],
   "execution_count": 15
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:09:03.789865Z",
     "start_time": "2025-08-04T02:09:03.781647Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.logical_not([0, 1]))",
   "id": "7e35caaf65dbb586",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ True False]\n"
     ]
    }
   ],
   "execution_count": 16
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:09:59.348428Z",
     "start_time": "2025-08-04T02:09:59.339389Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.logical_or([0, 1], [1, 0]))",
   "id": "286aa923aa0bc3ac",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ True  True]\n"
     ]
    }
   ],
   "execution_count": 17
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:11:31.721219Z",
     "start_time": "2025-08-04T02:11:31.714664Z"
    }
   },
   "cell_type": "code",
   "source": [
    "print(np.any([0, 1, 0, 0, 0, 0, ]))\n",
    "print(np.any([0, 0, 0, 0, 0, 0, ]))"
   ],
   "id": "77004818911c6d3a",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n",
      "False\n"
     ]
    }
   ],
   "execution_count": 18
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:12:34.111206Z",
     "start_time": "2025-08-04T02:12:34.100958Z"
    }
   },
   "cell_type": "code",
   "source": [
    "print(np.all([0, 1, 0, 0, 0, 0]))\n",
    "print(np.all([1, 1, 1, 1, 1]))"
   ],
   "id": "c8dcc3c124b13456",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n",
      "True\n"
     ]
    }
   ],
   "execution_count": 20
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:15:28.457498Z",
     "start_time": "2025-08-04T02:15:28.449035Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.array([1,2,3,4,5])\n",
    "print(np.where(arr > 2,arr,0))\n",
    "print(arr)"
   ],
   "id": "78e0b265a5a1493b",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 0 3 4 5]\n",
      "[1 2 3 4 5]\n"
     ]
    }
   ],
   "execution_count": 22
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:21:50.154925Z",
     "start_time": "2025-08-04T02:21:50.142102Z"
    }
   },
   "cell_type": "code",
   "source": [
    "np.random.seed(0)\n",
    "arr = np.random.randint(1,100,20)\n",
    "print(arr)\n",
    "arr.sort()\n",
    "print(arr)"
   ],
   "id": "4f218fb7590941e2",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[45 48 65 68 68 10 84 22 37 88 71 89 89 13 59 66 40 88 47 89]\n",
      "None\n",
      "[10 13 22 37 40 45 47 48 59 65 66 68 68 71 84 88 88 89 89 89]\n"
     ]
    }
   ],
   "execution_count": 26
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:26:00.697335Z",
     "start_time": "2025-08-04T02:26:00.687151Z"
    }
   },
   "cell_type": "code",
   "source": [
    "np.random.seed(0)\n",
    "arr = np.random.randint(1,100,20)\n",
    "print(arr)\n",
    "print(np.sort(arr))\n",
    "print(arr)\n",
    "print(np.argsort(arr))"
   ],
   "id": "16772c8263681989",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[45 48 65 68 68 10 84 22 37 88 71 89 89 13 59 66 40 88 47 89]\n",
      "[10 13 22 37 40 45 47 48 59 65 66 68 68 71 84 88 88 89 89 89]\n",
      "[45 48 65 68 68 10 84 22 37 88 71 89 89 13 59 66 40 88 47 89]\n",
      "[ 5 13  7  8 16  0 18  1 14  2 15  3  4 10  6 17  9 11 12 19]\n"
     ]
    }
   ],
   "execution_count": 28
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:27:27.764655Z",
     "start_time": "2025-08-04T02:27:27.740Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.unique(arr))",
   "id": "501283781db6267",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[10 13 22 37 40 45 47 48 59 65 66 68 71 84 88 89]\n"
     ]
    }
   ],
   "execution_count": 29
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:29:24.031243Z",
     "start_time": "2025-08-04T02:29:24.018609Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr1 = np.array([1,2,3])\n",
    "arr2 = np.array([4,5,6])\n",
    "print(np.concatenate((arr1,arr2)))"
   ],
   "id": "4aa7b9db45fdf786",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 2 3 4 5 6]\n"
     ]
    }
   ],
   "execution_count": 30
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:31:55.288360Z",
     "start_time": "2025-08-04T02:31:55.140466Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.split(arr,6))",
   "id": "89aeaf52b6ee0de1",
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "array split does not result in an equal division",
     "output_type": "error",
     "traceback": [
      "\u001B[31m---------------------------------------------------------------------------\u001B[39m",
      "\u001B[31mValueError\u001B[39m                                Traceback (most recent call last)",
      "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[32]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[38;5;28mprint\u001B[39m(np.split(arr,\u001B[32m6\u001B[39m))\n",
      "\u001B[36mFile \u001B[39m\u001B[32m~\\miniconda3\\Lib\\site-packages\\numpy\\lib\\_shape_base_impl.py:884\u001B[39m, in \u001B[36msplit\u001B[39m\u001B[34m(ary, indices_or_sections, axis)\u001B[39m\n\u001B[32m    882\u001B[39m     N = ary.shape[axis]\n\u001B[32m    883\u001B[39m     \u001B[38;5;28;01mif\u001B[39;00m N % sections:\n\u001B[32m--> \u001B[39m\u001B[32m884\u001B[39m         \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[32m    885\u001B[39m             \u001B[33m'\u001B[39m\u001B[33marray split does not result in an equal division\u001B[39m\u001B[33m'\u001B[39m) \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mNone\u001B[39;00m\n\u001B[32m    886\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m array_split(ary, indices_or_sections, axis)\n",
      "\u001B[31mValueError\u001B[39m: array split does not result in an equal division"
     ]
    }
   ],
   "execution_count": 32
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:33:53.000306Z",
     "start_time": "2025-08-04T02:33:52.994019Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.split(arr,[3,8,18]))",
   "id": "1f1b2955fe960886",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[array([45, 48, 65], dtype=int32), array([68, 68, 10, 84, 22], dtype=int32), array([37, 88, 71, 89, 89, 13, 59, 66, 40, 88], dtype=int32), array([47, 89], dtype=int32)]\n"
     ]
    }
   ],
   "execution_count": 33
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-04T02:36:30.876905Z",
     "start_time": "2025-08-04T02:36:30.600377Z"
    }
   },
   "cell_type": "code",
   "source": "print(np.reshape(arr, (4,6)))",
   "id": "5ad1ff553400a493",
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "cannot reshape array of size 20 into shape (4,6)",
     "output_type": "error",
     "traceback": [
      "\u001B[31m---------------------------------------------------------------------------\u001B[39m",
      "\u001B[31mValueError\u001B[39m                                Traceback (most recent call last)",
      "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[35]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[38;5;28mprint\u001B[39m(np.reshape(arr, (\u001B[32m4\u001B[39m,\u001B[32m6\u001B[39m)))\n",
      "\u001B[36mFile \u001B[39m\u001B[32m~\\miniconda3\\Lib\\site-packages\\numpy\\_core\\fromnumeric.py:324\u001B[39m, in \u001B[36mreshape\u001B[39m\u001B[34m(a, shape, order, newshape, copy)\u001B[39m\n\u001B[32m    322\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m copy \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[32m    323\u001B[39m     \u001B[38;5;28;01mreturn\u001B[39;00m _wrapfunc(a, \u001B[33m'\u001B[39m\u001B[33mreshape\u001B[39m\u001B[33m'\u001B[39m, shape, order=order, copy=copy)\n\u001B[32m--> \u001B[39m\u001B[32m324\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m _wrapfunc(a, \u001B[33m'\u001B[39m\u001B[33mreshape\u001B[39m\u001B[33m'\u001B[39m, shape, order=order)\n",
      "\u001B[36mFile \u001B[39m\u001B[32m~\\miniconda3\\Lib\\site-packages\\numpy\\_core\\fromnumeric.py:57\u001B[39m, in \u001B[36m_wrapfunc\u001B[39m\u001B[34m(obj, method, *args, **kwds)\u001B[39m\n\u001B[32m     54\u001B[39m     \u001B[38;5;28;01mreturn\u001B[39;00m _wrapit(obj, method, *args, **kwds)\n\u001B[32m     56\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m---> \u001B[39m\u001B[32m57\u001B[39m     \u001B[38;5;28;01mreturn\u001B[39;00m bound(*args, **kwds)\n\u001B[32m     58\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[32m     59\u001B[39m     \u001B[38;5;66;03m# A TypeError occurs if the object does have such a method in its\u001B[39;00m\n\u001B[32m     60\u001B[39m     \u001B[38;5;66;03m# class, but its signature is not identical to that of NumPy's. This\u001B[39;00m\n\u001B[32m   (...)\u001B[39m\u001B[32m     64\u001B[39m     \u001B[38;5;66;03m# Call _wrapit from within the except clause to ensure a potential\u001B[39;00m\n\u001B[32m     65\u001B[39m     \u001B[38;5;66;03m# exception has a traceback chain.\u001B[39;00m\n\u001B[32m     66\u001B[39m     \u001B[38;5;28;01mreturn\u001B[39;00m _wrapit(obj, method, *args, **kwds)\n",
      "\u001B[31mValueError\u001B[39m: cannot reshape array of size 20 into shape (4,6)"
     ]
    }
   ],
   "execution_count": 35
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "8839370e1950d998"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
